#include <bits/stdc++.h>

using namespace std;

int n,m;
int T,k,P;

int main(int argc, char const *argv[])
{
	scanf("%d%d",&n,&m);
	for (int i = 0; i < n; ++i)
	{
		int t,p=0;scanf("%d",&t);
		for (int j = 0; j < m; ++j)
		{
			int num;scanf("%d",&num);
			p+=num;
		}
		T+=(t+p);
		if(abs(p)>P){
			P=abs(p);
			k=i;
		}
	}
	printf("%d %d %d\n",T,k+1,P);

	return 0;
}